package ontime

import (
	"log"
	"os"
)

type Logger interface {
	Info(v ...interface{})
	Error(v ...interface{})
}

var DefaultLogger Logger = PrintfLogger(log.New(os.Stdout, "on_time: ", log.LstdFlags))

func PrintfLogger(l interface{ Print(...interface{}) }) Logger {
	return printfLogger{l}
}

type printfLogger struct {
	logger interface{ Print(...interface{}) }
}

func (pl printfLogger) Info(msg ...interface{}) {
	pl.logger.Print(msg)

}

func (pl printfLogger) Error(msg ...interface{}) {
	pl.logger.Print(msg)
}
